﻿using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Media; // First Add this
using System.Net;
using System.Net.Sockets;
using System.Reflection;

namespace Piano
{
    public partial class Form1 : Form
    {
        SoundPlayer SPBack = new SoundPlayer("\\Windows\\type.wav");
        SoundPlayer SPBack2 = new SoundPlayer(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName) + "\\Piano.wav");

        public Form1()
        {
            InitializeComponent();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            SystemSounds.Beep.Play();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            SystemSounds.Asterisk.Play();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            SystemSounds.Exclamation.Play();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            SystemSounds.Hand.Play();
        }

        private void button8_Click(object sender, EventArgs e)
        {
            SystemSounds.Question.Play();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            SoundPlayer SP = new SoundPlayer("\\Windows\\notify.wav");
            SP.Play();
        }

        private void checkBox1_CheckStateChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                SPBack.PlayLooping();
            }
            if (checkBox1.Checked == false)
            {
                SPBack.Stop();
            }
        }

        private void checkBox2_CheckStateChanged(object sender, EventArgs e)
        {
            {
                if (checkBox2.Checked == true)
                {
                    SPBack2.PlayLooping();
                }
                if (checkBox2.Checked == false)
                {
                    SPBack2.Stop();
                }
            }
        }
    }
}